<template>
  <fui-tag
    theme="light"
    class="ml-2"
    :type="statusList[(Number(state) - 1) as any] && statusList[(Number(state) - 1) as any].type"
    size="24"
    :padding="['8rpx', '16rpx']"
    >{{
      statusList[(Number(state) - 1) as any] &&
      statusList[(Number(state) - 1) as any].text
    }}</fui-tag
  >
</template>

<script lang="ts" setup>
	import { useI18n } from 'vue-i18n'
	
	const { t } = useI18n()
import { ref } from "vue";
withDefaults(defineProps<{ state: string | number }>(), {
  state: "0",
});

const statusList = ref([
  {
    text: t('order.state_1'),
    type: "warning",
  },

  {
    text: t('order.state_2'),
    type: "primary",
  },

  {
    text: t('order.state_3'),

    type: "primary",
  },

  {
    text: t('order.state_4'),

    type: "primary",
  },

  {
    text: t('order.state_5'),

    type: "success",
  },

  {
    text: t('order.state_6'),

    type: "danger",
  },
]);
</script>
